class Image < ActiveRecord::Base

  IMAGE_MIMES = {
    'jpg' => 'image/jpeg',
    'png' => 'image/png',
    'gif' => 'image/gif',
  }
  EXTENSIONS = IMAGE_MIMES.invert
  TO_PAM = {
    'image/jpeg' => 'jpegtopnm',
    'image/png'  => 'pngtopnm',
    'image/gif'  => 'giftopnm',
  }

  belongs_to :image_fact
  belongs_to :folder
  
  validates_uniqueness_of :leaf, :scope => [:folder_id]
end
